package com.gun.management.module.raffle.controller.admin.lotteryrule.vo;

import com.gun.management.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;
import java.util.Objects;

import static com.gun.management.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - 抽奖规则分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@AllArgsConstructor
public class LotteryRuleSetVO extends PageParam {

    /**
     * 产品id
     */
    @Schema(description = "产品id", example = "1")
    private Long productId;
    /**
     * 商品id
     */
    @Schema(description = "商品id", example = "1")
    private Long skuId;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LotteryRuleSetVO reqVO = (LotteryRuleSetVO) o;
        return skuId == reqVO.skuId && productId == reqVO.productId;
    }

    @Override
    public int hashCode() {
        return Objects.hash(skuId, productId);
    }

}